//
// Created by rengen.gong on 2021/12/7.
//

#ifndef LEARN1_USESTL_H
#define LEARN1_USESTL_H

#include "iostream"
#include "string"
#include "map"

using namespace std;

void useSTL() {

    string name[] = {
            "zs",
            "ls",
            "wmz"
    };

    double salary[] = {
            1200,
            2000,
            1450
    };

    map<string, double> sal;
    map<string, double>::iterator p;
    for (int i = 0; i < 3; i++) {
        sal.insert(make_pair(name[i], salary[i]));
    }
    sal["tom"] = 6156;
    sal["bob"] = 5999;

    for (p = sal.begin(); p != sal.end(); p++) {
        cout << p->first << "\t"
             << p->second
             << endl;
    }


}

#endif //LEARN1_USESTL_H
